package service

import (
	"context"
	__ "mt-server/basic/proto"
	"mt-server/handler/model"
)

// 消费预约
func (s *Server) Appointment(_ context.Context, in *__.AppointmentReq) (*__.AppointmentResp, error) {
	var Appoin model.Appointment
	Appoin = model.Appointment{
		NumberPeople: int32(in.NumberPeople),
		Information:  in.Information,
	}

	err := Appoin.AppointmentC()
	if err != nil {
		return &__.AppointmentResp{
			Msg:  "扣减失败",
			Code: 500,
		}, nil
	}

	return &__.AppointmentResp{
		Msg:  "扣减成功",
		Code: 200,
	}, nil

}
